using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableViewArea
	{
		public const string Table = "View_Area";
		public const string CityID = "CityID";
		public const string ProvinceID = "ProvinceID";
		public const string CityName = "CityName";
		public const string ProvinceName = "ProvinceName";
		public const string RegionID = "RegionID";
		public const string RegionName = "RegionName";
		public const string AreaName = "AreaName";
		public const string AreAreaID = "Are_AreaID";
		public const string AreaID = "AreaID";
		public const string ParentName = "ParentName";
	}
	
	[Serializable]
	public class BaseViewArea
		: IDbSessionEntity, IJsonClass
	{
		int? m_CityID;
		/// <summary>
        /// 
        /// </summary>
        public int? CityID
        {
            get { return m_CityID; }
            set { m_CityID = value; }
        }
		
		int? m_ProvinceID;
		/// <summary>
        /// 
        /// </summary>
        public int? ProvinceID
        {
            get { return m_ProvinceID; }
            set { m_ProvinceID = value; }
        }
		
		string m_CityName;
		/// <summary>
        /// 
        /// </summary>
        public string CityName
        {
            get { return m_CityName; }
            set { m_CityName = value; }
        }
		
		string m_ProvinceName;
		/// <summary>
        /// 
        /// </summary>
        public string ProvinceName
        {
            get { return m_ProvinceName; }
            set { m_ProvinceName = value; }
        }
		
		int? m_RegionID;
		/// <summary>
        /// 
        /// </summary>
        public int? RegionID
        {
            get { return m_RegionID; }
            set { m_RegionID = value; }
        }
		
		string m_RegionName;
		/// <summary>
        /// 
        /// </summary>
        public string RegionName
        {
            get { return m_RegionName; }
            set { m_RegionName = value; }
        }
		
		string m_AreaName;
		/// <summary>
        /// 
        /// </summary>
        public string AreaName
        {
            get { return m_AreaName; }
            set { m_AreaName = value; }
        }
		
		int? m_AreAreaID;
		/// <summary>
        /// 
        /// </summary>
        public int? AreAreaID
        {
            get { return m_AreAreaID; }
            set { m_AreAreaID = value; }
        }
		
		int m_AreaID;
		/// <summary>
        /// 
        /// </summary>
        public int AreaID
        {
            get { return m_AreaID; }
            set { m_AreaID = value; }
        }
		
		string m_ParentName;
		/// <summary>
        /// 
        /// </summary>
        public string ParentName
        {
            get { return m_ParentName; }
            set { m_ParentName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_CityID = reader[TableViewArea.CityID];
            m_ProvinceID = reader[TableViewArea.ProvinceID];
            m_CityName = reader[TableViewArea.CityName];
            m_ProvinceName = reader[TableViewArea.ProvinceName];
            m_RegionID = reader[TableViewArea.RegionID];
            m_RegionName = reader[TableViewArea.RegionName];
            m_AreaName = reader[TableViewArea.AreaName];
            m_AreAreaID = reader[TableViewArea.AreAreaID];
            m_AreaID = reader[TableViewArea.AreaID];
            m_ParentName = reader[TableViewArea.ParentName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
        }
		
		public string TableName
        {
            get { return TableViewArea.Table; }
        }
		#endregion
		
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_CityID = hashToRead["CityID"];
			 
             m_ProvinceID = hashToRead["ProvinceID"];
			 
             m_CityName = hashToRead["CityName"];
			 
             m_ProvinceName = hashToRead["ProvinceName"];
			 
             m_RegionID = hashToRead["RegionID"];
			 
             m_RegionName = hashToRead["RegionName"];
			 
             m_AreaName = hashToRead["AreaName"];
			 
             m_AreAreaID = hashToRead["AreAreaID"];
			 
             m_AreaID = hashToRead["AreaID"];
			 
             m_ParentName = hashToRead["ParentName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["CityID"] = CityID;
			
            hashToFill["ProvinceID"] = ProvinceID;
			
            hashToFill["CityName"] = CityName;
			
            hashToFill["ProvinceName"] = ProvinceName;
			
            hashToFill["RegionID"] = RegionID;
			
            hashToFill["RegionName"] = RegionName;
			
            hashToFill["AreaName"] = AreaName;
			
            hashToFill["AreAreaID"] = AreAreaID;
			
            hashToFill["AreaID"] = AreaID;
			
            hashToFill["ParentName"] = ParentName;
			
        }

        #endregion
		
	}
}
